﻿


CREATE PROCEDURE [dbo].[proc_Customer_AuditLog_GetItem]
	(
		@CustomerId nvarchar(50)
	)

AS
Begin
	Select Top 1 Id,
		CustomerId,
		IsNull(CustomerName,'') As CustomerName,
		Description,
		(select ename from employee where employee.username=audituser) as AuditUser,
		AuditDate,
--		(select title from customer_protect where customer_protect.id=type) as type
		IsNull((Select Top 1 EName From Employee Where UserName=Customer_AuditLog.SalesName),'') As [type]
	From Customer_AuditLog
	Where CustomerId=@CustomerId
End